const mysql =require("mysql2")
const pool=mysql.createPool({
  host:"localhost",
  port:'3306',
  database:require('dotenv').config().DataBase_PASSWORD,
  password:require('dotenv').config().DataBase,
  // password:"becauseofyou10",
  user:"root",
})
pool.getConnection(function(err, connection){
  connection.connect((err) => {
    if (err) {
      console.log("连接失败:", err);
    } else {
      console.log("数据库连接成功~");
    }
  })
});
module.exports=pool.promise();